<template>
<!-- 请先看text.md -->
  <Editor v-model="state"> </Editor>
</template>

<script>
import { ref, provide } from "vue";
import data from "./data.json";
// 组件
import Editor from "./packages/editor.jsx";

import { registerCongif as config } from "./utlis/editor-config.jsx";
// import { provide } from '@vue/runtime-core';
export default {
  components: {
    Editor,
  },
  setup() {
    const state = ref(data);
    provide("config", config); //组件配置

    return {
      state,
    };
  },
};
</script>

<style lang="scss">
.app {
  position: fixed;
  top: 20px;
  left: 20px;
  right: 20px;
  bottom: 20px;
}
</style>
